#ifndef VARIANT_H
#define VARIANT_H

#include <string>
#include <list>
#include <vector>

using namespace std;

class Variant
{
    public:
        typedef enum
        {
            String,
            Int,
            Float,
            StringVector,
            IntVector,
            FloatVector
        } Type;
        
        Variant(string value); 
        Variant(int value);
        Variant(float value);
        Variant(vector<string> value); 
        Variant(vector<int> value);
        Variant(vector<float> value);
        
        string tokenize();
        bool tokenized();
        void setTokenized(const bool& tokenized);
        static Variant parseTokens(const string& str, const Type& type);
    
        void setValue(string value);
        void setValue(int value);
        void setValue(float value);
        void setValue(vector<string> value);
        void setValue(vector<int> value);
        void setValue(vector<float> value);
        
        string toString() const;
        int toInt() const;
        float toFloat() const;
        vector<string> toStringVector() const;
        vector<int> toIntVector() const;
        vector<float> toFloatVector() const;
        
        Type type() const;
        static string replaceAll(string str, const string& from, const string& to);

    protected:
    
        string m_stringValue;
        int m_intValue;
        float m_floatValue;
        vector<string> m_stringVectorValue;
        vector<int> m_intVectorValue;
        vector<float> m_floatVectorValue;
        bool m_tokenized;
        
        Type m_type;
};

#endif
